﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="actives.aspx.cs" Inherits="UI.actives" %>
<%@ Import Namespace="Common" %>
<%@ Import Namespace="DAL" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title><%=active.Name %></title>
    <script src="system/js/jquery.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script type="text/javascript" src="/js/fastclick.js"></script>
    <style>
    /*
    img 
    {
        width:100%;
        height:100%;
        object-fit: cover;
    }
    */
    body,html{padding:0px; margin:0px; width:100%; height:100%;}
    .hidden{display:none;}
    .active{width:100%;}
    .active .img{width:100%; float:left;}
    .active .img img{width:100%;}
    .active .title{width:100%; height:auto; text-align:center; float:left; margin-top:10px;}
    .active .title img{width:60%;}
    .active .context{width:100%; float:left; margin-top:10px; position:relative;}
    .active .context img{width:100%; float:left;}
    .active .context .text{width:80%; float:left; margin-top:10px; position:absolute; top:12%; left:10%;}
    .active .context .top{width:96%; margin-left:2%; float:left;}
    .active .context .middle{width:79%; margin-left:2%; background:url(/img/22.png);background-size:100%; float:left; padding-left:10%; padding-right:7%; font-size:14px; line-height:20px; }
    .active .context .bottom{width:96%; margin-left:2%; float:left;}
    .active .voice{width:100%; height:120px; margin-top:20px; float:left; text-align:center; position:relative;}
    .active .voice .sound{width:30vw; height:30vw; margin:0 auto; background:url(/img/voice.jpg); background-size:30vw 30vw; opacity:1; border-radius:15vw;  position:absolute; left:35vw; z-index:2;}
    .active .voice .shadow{width:28vw; height: 28vw; margin:0 auto; border-radius: 14vw; background: #ff3d3d; position:absolute; left:36vw; top:1vw; z-index:1;}
    .active .player{width:90%; height:30px; line-height:30px; margin-top:10px; margin-left:5%; float:left; color:#ff3d3d; font-size:14px; text-align:center;}
    .active .player .square{width:100%; height:35px; float:left; border-raidus:3px; background-color:#a0e75a; color:#319002; font-size:14px; line-height:35px;}
    .active .player .square img{height:35px; float:right; margin-right:3px;}
    .active .footer{width:100%; float:left; margin-top:10px;}
    .active .footer img{width:100%; float:left;}
    .meng{background:#000000; opacity:0.8; width:100%; height:100%; position:absolute; top:0px; left:0px;  z-index:100;}
    .arrow{width:80%; position:fixed; top:0px; right:20px; z-index:101;}
    .arrow img{width:100%;}
    .hongbao{width:150px; position:fixed; top:10px; right:0px; z-index:100;}
    .hongbao img{width:150px}
    .over{width:150px; position:fixed; top:10px; right:0px;  z-index:100;}
    .jieshu{width:100%; position:fixed; bottom:0px; right:110px;  z-index:100;}
    .over img{width:100%;}
    .takemoney{width:100%; height:30px; font-size:30px; color:yellow; font-weight:bold; position:absolute; left:5px; top:80%; text-align:center; z-index:100;}
    .takemoney font{font-size:12px;}
    .usercenter{width:80px; height:80px; position:fixed; right:10px; bottom:10px; z-index:100;}
    .usercenter img{width:100%; height:100%;}
    .border-top{background:linear-gradient(180deg, #c6c6c6, #c6c6c6 50%, transparent 50%) top	left/ 100% 1px no-repeat,	linear-gradient(90deg,#c6c6c6, #c6c6c6 50%, transparent 50%) top	right / 0px 100% no-repeat,	linear-gradient(0,	#c6c6c6, #c6c6c6 50%, transparent 50%) bottom right / 100% 0px no-repeat,	linear-gradient(-90deg, #c6c6c6, #c6c6c6 50%, transparent 50%) bottom left/ 0px 100% no-repeat;border-left:0px; border-left:0px;	}
    .phone{width:100%; height:50px; position:fixed; z-index:99; bottom:0px; background-color:#fff;}
    .phone .left{width:50px; float:left;}
    .phone .left img{width:40px; margin-top:5px; margin-left:5px;}
    .phone .right{width:150px; float:left; position:relative;}
    .phone .right .num{width:150px; height:22px; font-size:18px; color:#4d4e4e; padding-top:3px;}
    .phone .right .tip{width:150px; height:20px; font-size:12px; color:#8c8d8d;}
    .phone .right .delete{width:20px; height:20px; position:absolute; right:8px; top:-10px;}
    .phone .right .delete img{width:15px; height:15px;}
    #iframe{width:100%; height:100% !important;}
    @-webkit-keyframes halo { 0% { opacity: 1;-webkit-transform: scale(1); }
    50% {opacity: 0; }
    100%{opacity: 0;-webkit-transform: scale(3.0); } }
    * {
    -webkit-touch-callout:none;
    -webkit-user-select:none;
    -khtml-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
    
    }
    .ui-border-radius {
  border: 1px solid #6fb44d;
  border-radius: 4px; }
  @media screen and (-webkit-min-device-pixel-ratio: 2) {
    .ui-border-radius {
      position: relative;
      border: 0; }
      .ui-border-radius:before {
        content: "";
        width: 200%;
        height: 200%;
        position: absolute;
        top: 0;
        left: 0;
        border: 1px solid #6fb44d;
        -webkit-transform: scale(0.5);
        -webkit-transform-origin: 0 0;
        padding: 1px;
        -webkit-box-sizing: border-box;
        border-radius: 8px;
        pointer-events: none; } }
        
        
        span img{width:20px;}
    </style>
</head>
<body>
    <%if(active.Link==""){ %>
    <div class="active">
        <div class="img"><img src="<%=active.Img %>"/></div>
        <div class="title"><img src="/img/title.png"/></div>
        <div class="context">
            <div class="top"><img src="/img/11.png"/></div>
            <div class="middle">
            <%if (active.PrizeType == 3){ %>
            读取下面文字后领取红包：<br>
            <%} %>
            <div style="font-weight:bold; font-size:15px; padding-top:5px;">
            <%=active.Context%>
            </div>
            </div>
            <div class="bottom"><img src="/img/33.png"/></div>
        </div>
        <div class="player"></div>
        <%if (hastake==false && active.PrizeType == 3){ %>
        <div class="voice"><div class="shadow"></div><div id="sound" class="sound"></div></div>
        <%} %>
        <div class="footer"><img src="/img/foot.png"/></div>
    </div>
    <%}else{ %>
    <div id="iframe">
        <% if(active.LinkText!=""){%>
            <%=active.LinkText%>
        <%}else{ %>
            <iframe id="iframes" src="<%=active.Link%>" frameborder="0" style="width:100%;height:100%;"></iframe>
        <%} %>
    </div>
    <%} %>

    <%if(!string.IsNullOrEmpty(active.Mobile)){ %>
    <div class="phone border-top"><div class="left"><img src="/img/phone.png"/></div><div class="right"><a href="tel:<%=active.Mobile %>"><div class="num"><%=active.Mobile %></div><div class="tip">点击这里联系我吧</div></a><div class="delete" onclick="Remove_Phone(this)"><img src="/img/delete.png"/></div></div></div>
    <%} %>
    <div class="usercenter"><a href="/member/index.aspx"><img src="/img/usercenter.png"/></a></div>
    
    <%--<div class='meng <%=(active.PrizeType == 3 && active.State==1 && hastake==false) || active.State==2 || active.AllMoney==active.TakeMoney?"hidden":"" %>' onclick="Hidden_Meng(this)"></div>--%>

    <%if(active.State==2){ %>
    <div class="jieshu" onclick="Hidden(this)" style="width:100px; height:100px; right:190px;"><img src="/img/pause.png" style="height:100px !important;"/></div>
    <%}else{ %>
    <%if (hastake==false){ %>
    <%if (active.PrizeType == 1 && active.AllMoney>active.TakeMoney) { %>
    <div id="hongbao1" class="hongbao" onclick="Chai_HongBao()"><img src="/img/hongbaos1.png"/><div class="takemoney" style="top:50px; color:#f7f264;"><%=prizemoney %><font> 元</font></div></div>
    <%}if (active.PrizeType == 2 && active.AllMoney>active.TakeMoney) {  %>
    <!--<div id="arrow" class="arrow" onclick="Hidden(this)"><img src="/img/arrows.png"/></div>-->
    <div id="hongbao2" class="hongbao" onclick="Hidden(this)" style="top:0px;"><img src="/img/hongbaos2.png"/><div class="takemoney" style="top:110px; font-size:20px; color:#f7f264"><%=prizemoney %><font> 元</font></div></div>
    <%}if (active.PrizeType == 3 && active.AllMoney>active.TakeMoney) { %>
    <div id="hongbao1" class="hongbao hidden" onclick="Chai_HongBao()"><img src="/img/hongbaos1.png"/><div class="takemoney" style="top:60%; color:red"><%=prizemoney %><font> 元</font></div></div>
    <%}if(active.AllMoney<=active.TakeMoney){ %>
    <div class="jieshu" onclick="Hidden(this)" style="width:100px; height:100px;"><img src="/img/over.png" style="height:90px !important;" /></div>
    <%}}else{ %>
    <div class="over" onclick="Hidden(this)"><img src="/img/success.png"/><div class="takemoney" style="top:100px; color:#f7f264; font-size:20px;"><%=prizemoney %><font> 元</font></div></div>
    <%}} %>
    <script src="/js/jquery-weui.js"></script>
    <script>
        var lag = 0, lng = 0, address="", province="", city="", area="";
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端$.alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: 'wx1a4dea3fd54864b9', // 必填，公众号的唯一标识
            timestamp: '<%=timestamp %>', // 必填，生成签名的时间戳
            nonceStr: '<%=noncestr %>', // 必填，生成签名的随机串
            signature: '<%=signature %>', // 必填，签名，见附录1
            jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'onMenuShareQZone',
            "chooseImage",
            "getLocation",
            "openLocation",
            "uploadImage",
            "downloadImage",
            "previewImage",
            "startRecord",
            "stopRecord",
            "playVoice",
            "pauseVoice",
            "stopVoice",
            "translateVoice",
            "chooseWXPay"
            ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });

        wx.ready(function () {
            FastClick.attach(document.body);
            wx.onMenuShareTimeline({
                title: '<%=active.Name %>', // 分享标题
                link: 'http://www.mengshen666.cn/actives.aspx?id=<%=DESEncrypt.Encrypt(active.ID.ToString()) %>', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: '<%=active.Img %>', // 分享图标
                success: function () {
                    var data = {};
                    data.act = "Inc_ShareCount";
                    data.sid = "<%=active.ID %>";
                    Ajax.Post("/tools/API.ashx", data, function (r) {
                        var json = $.parseJSON(r);
                        if (json.state) {
                        } else {
                        }
                    });

                    if ("<%=active.State %>" == "2") {
                        $.alert("该活动已暂停");
                        return;
                    }
                    Position_Address(false, function () {
                        if ("<%=active.Range %>" == "2") {
                            if ("<%=active.Province %>".indexOf(province) == -1 && province.indexOf("<%=active.Province %>") == -1) {
                                $.alert("您不在活动范围之内");
                                return;
                            }
                        }
                        if ("<%=active.Range %>" == "3") {
                            if ("<%=active.City %>".indexOf(city) == -1 && city.indexOf("<%=active.City %>") == -1) {
                                $.alert("您不在活动范围之内");
                                return;
                            }
                        }
                        if ("<%=active.Range %>" == "4") {
                            if ("<%=active.Area %>".indexOf(area) == -1 && area.indexOf("<%=active.Area %>") == -1) {
                                $.alert("您不在活动范围之内");
                                return;
                            }
                        }
                        if ("<%=active.Range %>" == "5") {
                            if (CalDistance(parseFloat("<%=active.Lat %>"), parseFloat("<%=active.Lng %>"), lat, lng) > parseInt("<%=active.Metre %>")) {
                                $.alert("您不在活动范围之内");
                                return;
                            }
                        }
                        //用户确认分享后执行的回调函数
                        if ("<%=active.PrizeType %>" == "2") {
                            data.act = "Save_PrizeRecord";
                            data.sid = "<%=active.ID %>";
                            data.userid = "<%=uinfo.ID %>";
                            data.createid = "<%=active.UserID %>";
                            data.money = "<%=prizemoney %>";
                            data.prizetype = "<%=active.PrizeType %>";
                            data.token = "<%=DESEncrypt.Encrypt(uinfo.ID.ToString()) %>";
                            data.openid = "<%=uinfo.OpenID %>";
                            data.flag = "share";
                            data.lat = lat;
                            data.lng = lng;
                            data.province = province;
                            data.city = city;
                            data.area = area;
                            data.address = address;
                            Ajax.Post("/tools/API.ashx", data, function (r) {
                                var json = $.parseJSON(r);
                                if (json.state) {
                                    $("#arrow").hide();
                                    $("#hongbao2 .takemoney").remove();
                                    $("#hongbao2 img").attr("src", "/img/success.png");
                                    $("#hongbao2").append('<div class="takemoney" style="top:100px; color:#f7f264; font-size:20px;">' + data.money + '<font> 元</font></div>');
                                } else {
                                    $.alert(json.msg);
                                }
                            });
                        }
                    });
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });

            wx.onMenuShareAppMessage({
                title: '<%=active.Name %>', // 分享标题
                desc: '<%=active.Context %>', // 分享描述
                link: 'http://www.mengshen666.cn/actives.aspx?id=<%=DESEncrypt.Encrypt(active.ID.ToString()) %>', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: '<%=active.Img %>', // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });

            wx.getLocation({
                type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
                success: function (res) {
                    var data = {};
                    data.act = "Tran_Position";
                    data.lat = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                    data.lng = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                    Ajax.Post("/tools/API.ashx", data, function (r) {
                        var json = $.parseJSON(r);
                        lat = json.locations[0].lat;
                        lng = json.locations[0].lng;



                    });
                }
            });

            wx.onVoicePlayEnd({
                success: function (res) {
                    var localId = res.localId; // 返回音频的本地ID
                    $(".player img").attr("src", "/img/sound.jpg");
                }
            });

            $("#sound").on("touchstart", function (e) {
                $(".voice .shadow").css("-webkit-animation", "halo 2s 0s infinite ease-out");
                $(this).css("opacity", "0.7");
                $(".player").html("录音中...");
                wx.startRecord();
                e.preventDefault();
                return false;
            }).on("touchcancel", function (e) {
                e.preventDefault();
                return false;
            }).on("touchend", function () {
                $(".voice .shadow").css("-webkit-animation", "");
                $(this).css("opacity", "1");
                wx.stopRecord({
                    success: function (res) {
                        $(".player").html('<div class="square ui-border-radius" path="' + res.localId + '" onclick="StartPlayer(this)"><font id="result">识别中...</font><img src="/img/sound.jpg"/></div>');
                        wx.translateVoice({
                            localId: res.localId, // 需要识别的音频的本地Id，由录音相关接口获得
                            isShowProgressTips: 1, // 默认为1，显示进度提示
                            success: function (res5) {
                                var percent;
                                if (JSON.stringify(res5).indexOf("translateResult") == -1) {
                                    percent = 0;
                                    $("#result").html("未识别到语音，请重试...");
                                } else {
                                    percent = Math.ceil(compare(res5.translateResult.split(""), "<%=active.Context%>".split("")));
                                    $("#result").html("匹配度：" + percent + "%");
                                }

                                if (percent >= parseInt("<%=active.Degree %>")) {
                                    if ("<%=active.PrizeType%>" == "3" && "<%=active.State%>" == "1" && "<%=hastake%>".toLowerCase() == "false") {
                                        $("#hongbao1,.meng").removeClass("hidden").show();
                                    }
                                } else {
                                    $.alert("匹配度不足<%=active.Degree %>%不能领取红包哦，请继续努力吧");
                                }
                            },
                            fail: function () {
                                $("#result").html("未识别到语音，请重试...");
                            }
                        });
                    }
                });
            }).on("touchmove", function (e) {
                e.preventDefault();
            });
        });
        $(".meng").height(800);
        function Chai_HongBao() {
            if ("<%=active.State %>" == "2") {
                $.alert("该活动已暂停");
                return;
            }
            Position_Address(true, function () {

                if ("<%=active.Range %>" == "2") {
                    if ("<%=active.Province %>".indexOf(province) == -1 && province.indexOf("<%=active.Province %>") == -1) {
                        $.hideLoading();
                        $.alert("您不在活动范围之内");
                        return;
                    }
                }
                if ("<%=active.Range %>" == "3") {
                    if ("<%=active.City %>".indexOf(city) == -1 && city.indexOf("<%=active.City %>") == -1) {
                        $.hideLoading();
                        $.alert("您不在活动范围之内");
                        return;
                    }
                }
                if ("<%=active.Range %>" == "4") {
                    if ("<%=active.Area %>".indexOf(area) == -1 && area.indexOf("<%=active.Area %>") == -1) {
                        $.hideLoading();
                        $.alert("您不在活动范围之内");
                        return;
                    }
                }
                if ("<%=active.Range %>" == "5") {
                    if (CalDistance(parseFloat("<%=active.Lat %>"), parseFloat("<%=active.Lng %>"), lat, lng) > parseInt("<%=active.Metre %>")) {
                        $.hideLoading();
                        $.alert("您不在活动范围之内");
                        return;
                    }
                }

                if ("<%=active.PrizeType %>" == "1" || "<%=active.PrizeType %>" == "3") {
                    var data = {};
                    data.act = "Save_PrizeRecord";
                    data.sid = "<%=active.ID %>";
                    data.userid = "<%=uinfo.ID %>";
                    data.createid = "<%=active.UserID %>";
                    data.money = "<%=prizemoney %>";
                    data.prizetype = "<%=active.PrizeType %>";
                    data.flag = "noshare";
                    data.token = "<%=DESEncrypt.Encrypt(uinfo.ID.ToString()) %>";
                    data.openid = "<%=uinfo.OpenID %>";
                    data.lat = lat;
                    data.lng = lng;
                    data.province = province;
                    data.city = city;
                    data.area = area;
                    data.address = address;
                    Ajax.Post("/tools/API.ashx", data, function (r) {
                        $.hideLoading();
                        var json = $.parseJSON(r);
                        if (json.state) {
                            $("#hongbao1 img").attr("src", "/img/success.png");
                            $("#hongbao1 .takemoney").remove();
                            $("#hongbao1").append('<div class="takemoney" style="top:100px; color:#f7f264; font-size:20px;">' + data.money + '<font> 元</font></div>').attr("onclick", "Hidden(this)");
                        } else {
                            $.alert(json.msg);
                        }
                    });
                }
            });
        };
        function Hidden_Meng(o) {
            $(o).fadeOut(300);
            $(".hongbao").fadeOut(300);
            $(".arrow").fadeOut(300);
            $(".over,.jieshu").fadeOut(300);
        };
        function Hidden(o) {
            $(".meng").fadeOut(300);
            $(".hongbao").fadeOut(300);
            $(".arrow").fadeOut(300);
            $(".over,.jieshu").fadeOut(300);
        };

        var EARTH_RADIUS = 6378137.0;    //单位M
        var PI = Math.PI;
        function getRad(d) {

            return d * PI / 180.0;

        };
        function CalDistance(lat1, lng1, lat2, lng2) {

            var radLat1 = getRad(lat1);

            var radLat2 = getRad(lat2);

            var a = radLat1 - radLat2;

            var b = getRad(lng1) - getRad(lng2);

            var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));

            s = s * EARTH_RADIUS;

            s = Math.round(s * 10000) / 10000.0;

            return s;

        };

        function Remove_Phone(o) {
            $(o).parent().parent().remove();
        };


        $("#js_article img").each(function () {
            var img = $(this);

            var img_src = img.attr("src");
            var frameid = 'frameimg' + Math.random();

            if ($(this).attr("class") == "__bg_gif") {
                window.img = '<img id="img" width="100%" src=\'' + img_src + '?' + Math.random() + '\' /><script>' + '/script>';
                img.parent().append('<iframe id="' + frameid + '" src="javascript:parent.img;" frameBorder="0" scrolling="no" width="40" height="40"></iframe>');
            } else {
                window.img = '<img id="img" style="width:100%;" src=\'' + img_src + '?' + Math.random() + '\' /><script>window.onload = function() { parent.document.getElementById(\'' + frameid + '\').height = document.getElementById(\'img\').height+\'px\'; }<' + '/script>';
                img.parent().append('<iframe id="' + frameid + '" src="javascript:parent.img;" frameBorder="0" scrolling="no" width="100%;"></iframe>');
            }
            img.remove();

        });

        function StartPlayer(o) {
            wx.playVoice({
                localId: $(o).attr("path") // 需要播放的音频的本地ID，由stopRecord接口获得
            });
            $(".player img").attr("src","/img/sound.gif");
        }
        

        function compare(x, y) {
            var z = 0;
            var s = x.length + y.length;

            x.sort();
            y.sort();
            var a = x.shift();
            var b = y.shift();

            while (a !== undefined && b !== undefined) {
                if (a === b) {
                    z++;
                    a = x.shift();
                    b = y.shift();
                } else if (a < b) {
                    a = x.shift();
                } else if (a > b) {
                    b = y.shift();
                }
            }
            return z / s * 200;
        }
        function Position_Address(show, fun) {
            if (show) { $.showLoading("领取中..."); }
            wx.getLocation({
                type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
                success: function (res) {
                    var data = {};
                    data.act = "Tran_Position";
                    data.lat = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                    data.lng = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                    Ajax.Post("/tools/API.ashx", data, function (r) {
                        var json = $.parseJSON(r);
                        lat = json.locations[0].lat;
                        lng = json.locations[0].lng;
                        data = {};
                        data.act = "Position_Address";
                        data.lat = lat; // 纬度，浮点数，范围为90 ~ -90
                        data.lng = lng; // 经度，浮点数，范围为180 ~ -180。
                        Ajax.Post("/tools/API.ashx", data, function (r) {
                            var json = $.parseJSON(r);
                            province = json.result.address_component.province;
                            city = json.result.address_component.city;
                            area = json.result.address_component.district;
                            address = json.result.address;
                            fun();
                        });
                    });
                }
            });
        }
        var icount = 0;
        var browser = {
            versions: function () {
                var u = navigator.userAgent, app = navigator.appVersion;
                return {//移动终端浏览器版本信息 
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
                    iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
                };
            } (),
            language: (navigator.browserLanguage || navigator.language).toLowerCase()
        }

        if (browser.versions.ios || browser.versions.iPhone || browser.versions.iPad) {
            $("#iframes").load(function () {
                icount++;
                if (icount == 2) {
                    $("#iframes").attr("style", "width:100%; height:100%; margin-left:-70px");
                }
            });
        }
    </script>
</body>
</html>
